Skip to content

Canonicalize tests to @safetestset for isolation#12

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:canonicalize-safetestset
Closed

Canonicalize tests to @safetestset for isolation#12
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:canonicalize-safetestset

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Canonicalizes the test suite so each independent test unit runs in its own module via @safetestset, matching the OrdinaryDiffEq structure (isolation between tests + world-age safety).

Classification

Plain-@testset repo: the Core group was a single @testset "SciMLIterators.jl" wrapping module-level f/prob setup and five nested @testset units; QA was a plain include.

Changes

  • test/runtests.jl: each of the five Core units (Solution tuples, Integrator tuples, Integrator intervals, TimeChoiceIterator, Inplace ODE) becomes its own @safetestset. Each carries self-contained imports (using SciMLIterators, OrdinaryDiffEq, Test) and re-creates the small shared f/prob setup. The outer grouping @testset (whose only file-scope content was that shared setup) is dropped.
  • QA include(...) is wrapped in @safetestset "Quality Assurance".
  • Project.toml: added SafeTestsets to [extras], [targets].test, and [compat] ("0.1, 1").

No package macros / $-interpolation in any unit body, so inline @safetestset bodies are safe (no include() indirection needed).

Behavior preserved

Same tests, same assertions, unchanged GROUP-dispatch ladder. The two pre-existing @test_broken lines in QA are untouched.

Verification (local, julia 1.11)

  • GROUP=Core Pkg.test(): all 5 units pass (31 assertions: 3+9+9+7+3).
  • GROUP=QA Pkg.test(): 7 pass, 2 broken (matching the pre-existing @test_broken count).

Ignore until reviewed by @ChrisRackauckas.

Convert the Core test group from a single plain @testset wrapping five
nested @testset units (sharing module-level f/prob setup) into five
independent @safetestset units, each running in its own module. Each unit
carries its own self-contained imports (using SciMLIterators, OrdinaryDiffEq,
Test) and re-creates the shared f/prob setup. Wrap the QA group's include in
@safetestset as well, matching the canonical OrdinaryDiffEq structure.

Same tests run with the same assertions; only the isolation wrapping changes.
Add SafeTestsets to the test deps ([extras]/[targets].test + [compat]).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

Superseded by the v1.2 folder conversion on sciml-testing-rollout (#11).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants